package com.company.ThreadLearn;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

class ThreadProtect2 extends Thread{
    public void run(){
        while (true){
            System.out.println(LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")));
            try{
                Thread.sleep(1000);
            }catch (InterruptedException e){
                break;
            }
        }
    }
}
